<template>
	<view class="content" :style="theme">
		<view v-if="!tjSuccess" class="u-demo-block">
			<view class="u-demo-block__content">
				<u--form labelPosition="top" :model="model1">
					<u-form-item>
						<view class="labelWz">
							反馈标题：
						</view>
						<u--input v-model="model1.title" fontSize="28rpx" customStyle="height:88rpx;border-radius: 8rpx;box-sizing: border-box;flex: none;background: #F7F7F7;padding: 0 30rpx" border="none" placeholder="请输入反馈标题" maxlength="30">
						</u--input>
					</u-form-item>
					<view style="height: 20rpx;"></view>
					<u-form-item>
						<view class="labelWz">
							反馈内容：
						</view>
						<u--textarea v-model="model1.content" height="310rpx" fontSize="28rpx" customStyle="border-radius: 8rpx;background: #F7F7F7;padding: 25rpx 30rpx" border="none" placeholder="有什么想说的，尽管给我留言吧（200个字以内）" maxlength="200">
						</u--textarea>
					</u-form-item>
				</u--form>
				<view class="foot">
					<view class="footBtn" @click="$noMultipleClicks(submit)">提交</view>
				</view>
			</view>
		</view>
		<view v-else class="fkcg">
			<image mode="widthFix" :src="imgHost+'/ic_feedsuccess.png'"></image>
			<view class="sucwz mt30">
				反馈成功
			</view>
			<view class="tips mt20">
				感谢你对我们的关注与支持，我们会认真处理你的反馈，尽快修复和完善相关功能
			</view>
			<view class="gbBtn" @click="navback">
				关闭
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				noClick: true,
				model1: {},
				tjSuccess: false
			}
		},
		methods: {
			navback() {
				uni.navigateBack({
					delta:1
				})
			},
			submit() {
				if (!this.model1.title) {
					this.$app.showToast('请输入反馈标题')
					return false
				}
				if (!this.model1.content) {
					this.$app.showToast('请输入反馈内容')
					return false
				}
				this.$app.ajax({
					data: {
						userId: this.userInfo.id,
						param: {
							title: this.model1.title,
							content: this.model1.content
						}
					},
					api: this.$api.feedback()
				}).then((res) => {
					if (res.errorCode == '000000') {
						this.tjSuccess = true
						// this.$app.showToast('提交成功')
						// setTimeout(() => {
						// 	uni.navigateBack({
						// 		delta: 1
						// 	})
						// }, 1000)
					}
				}).catch(() => {})
			},
		},
	}
</script>
<style>
	page {
		background-color: #fff;
	}
</style>
<style lang="scss" scoped>
	.content {
		padding: 30rpx;
		box-sizing: border-box;
	}

	.foot {
		position: fixed;
		left: 30rpx;
		bottom: 30rpx;
		width: 690rpx;
		z-index: 999;
	}
	.labelWz {
		font-size: 32rpx;margin-bottom: 20rpx;font-weight: bolder;color: #222222;width: 100%
	}
	.fkcg {
		display: flex;
		align-items: center;
		justify-content: center;
		flex-direction: column;
		text-align: center;
		box-sizing: border-box;
		padding: 0 35rpx;
		height: 70vh;
		image {
			width: 180rpx;
			height: 180rpx;
		}
		.sucwz {
			font-size: 36rpx;
			font-family: PingFangSC, PingFang SC;
			font-weight: bolder;
			color: #222222;
		}
		.tips {
			font-size: 26rpx;
			font-family: PingFangSC, PingFang SC;
			font-weight: 400;
			color: #999999;
		}
		.gbBtn {
			width: 200rpx;
			height: 72rpx;
			border-radius: 36rpx;
			text-align: center;
			border: 1rpx solid $color;
			font-size: 28rpx;
			font-family: PingFangSC, PingFang SC;
			font-weight: 400;
			margin-top: 60rpx;
			color: $color;
			line-height: 72rpx;
			border-radius: 36rpx;
		}
	}
</style>
